<?php

class dbaConf
{

    function dbaConf (&$dba)
    {
        $this->dba = &$dba;
    }
    
    function insert ($instance, $thumb_height, $thumb_width, $height, $width, $rows, $cols)
    {
        return $this->dba->query("insert into ".$this->dba->tableforwarder."_mod_gallery_conf (instance, thumb_height, thumb_width, height, width, rows, cols) values ('$instance', '$thumb_height', '$thumb_width', '$height', '$width', '$rows', '$cols');");
    }

    function update ($instance, $thumb_height, $thumb_width, $height, $width, $rows, $cols)
    {
        return $this->dba->query("update ".$this->dba->tableforwarder."_mod_gallery_conf set thumb_height='$thumb_height', thumb_width='$thumb_width', height='$height', width='$width', rows='$rows', cols='$cols' where instance='$instance';");
    }
    
    function exists ($instance)
    {
        $sth = $this->dba->query("select * from ".$this->dba->tableforwarder."_mod_gallery_conf where instance='$instance';");
        if (is_object($sth))
        {
            if ($sth->num_rows())
            {
                $sth->free();
                return true;
            }
        }
    }

    function get ($instance)
    {
        $sth = $this->dba->query("select * from ".$this->dba->tableforwarder."_mod_gallery_conf where instance='$instance' limit 1;");
        if (is_object($sth))
        {
            $row = $sth->fetch_row_Array();
            $sth->free();
            return $row;
        }
    }

}

?>